{extend name="layout"/}

{block name="breadcrumb"}
<h2>反馈消息列表</h2>
<ol class="breadcrumb">
    <li><a href="{:url('index/index')}">首页</a></li>
    <li><strong>反馈消息列表</strong></li>
</ol>
{/block}

{block name="search"}
{include file='feedback/search'/}
{/block}

{block name="main"}
<div class="ibox float-e-margins">
    <div class="ibox-title">
        <h5>反馈消息列表</h5>
    </div>
    <div class="ibox-content">
        <p>
        </p>
        <div class="table-responsive table-elem">
            <p>共 {$count} 条数据</p>
            <table class="table table-striped">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>用户昵称</th>
                    <th>反馈内容</th>
                    <th>联系方式</th>
                    <th>处理状态</th>
                    <th>处理时间</th>
                    <th>反馈时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {foreach $model as $key=>$vo }
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.nickname}</td>
                    <td>{$vo.content}</td>
                    <td>{$vo.phone}</td>
                    <td>
                        <span class="label {$vo.deal_status == 1 ? 'label-info' : 'label-danger'}">{$vo.dealStatusText}</span>
                    </td>
                    <td>{$vo.deal_time}</td>
                    <td>{$vo.create_time}</td>
                    <td>
                        <a href="javascript:void(0);" data-id="{$vo.id}" class="disabled-one btn btn-warning btn-xs">{$vo.deal_status == 1 ? '未处理' : '已处理'}</a>
                    </td>
                </tr>
                {/foreach}
                </tbody>
            </table>
            {$model|raw}
        </div>

    </div>
</div>
{/block}

{block name="jsFile"}
{load href="/static/css/select2.min.css" /}
{load href="/static/js/select2.min.js" /}
<script>
    let data = [];
    if ("{$oauth.id}" > 0) {
        data = [{'id': "{$oauth.id}", 'text': "{$oauth.nickname} | {$oauth.phone}"}];
    }
    $('.oauth_select2').select2({
        data: data,
        ajax: {
            type: 'GET',
            url: "{:url('oauth/search')}",
            dataType: 'json',
            delay: 250,
            data: function (params) {
                return {
                    q: params.term // search term 请求参数 ， 请求框中输入的参数
                };
            }
        },
        placeholder: '请输入用户昵称',//默认文字提示
        // language: "zh-CN",
        language: {
            inputTooShort: function () {
                return "请至少输入一个字符";
            }
        },
        tags: false,//允许手动添加
        allowClear: true,//允许清空
        escapeMarkup: function (markup) {
            return markup;
        }, // 自定义格式化防止xss注入
        minimumInputLength: 1,//最少输入多少个字符后开始查询
        formatResult: function formatRepo(repo) {
            return repo.text;
        }, // 函数用来渲染结果
        formatSelection: function formatRepoSelection(repo) {
            return repo.text;
        } // 函数用于呈现当前的选择
    });

</script>
{/block}